package demo1;

public class StringDemo {

	public static void main(String[] args) {
		String name = "李大帅";
		String name1 = new String("李大帅"); //new 
		String name2 = name1;//引用传递
		System.out.println(name==name1); //比较引用
		System.out.println(name==name2); //比较引用
		System.out.println(name1==name2); //比较引用
		
		//equals  比较内容
		System.out.println("equals="+name.equals(name1));
		System.out.println("equals="+name.equals(name2));
		System.out.println("equals="+name1.equals(name2));
	}
}
